var sTopBtn = document.getElementsByClassName('s-top-btn')[0],
  header = document.getElementsByClassName('list-hd')[0];

addEvent(window, 'scroll', function() {
  // 获取滚动条距离顶部高度
  var sTop = getScrollOffset().top;
  // 不在最上方就显示返回顶部按钮
  sTopBtn.style.display = sTop ? 'block' : 'none';
  // sTop ? sTopBtn.style.display = 'block' : sTopBtn.style.display = 'none';
});

addEvent(sTopBtn, 'click', function() {
  window.scrollTo(0, 0);
});

addEvent(header, 'click', function() {
  window.scrollTo(0, 0);
});
